package com.bw.vip.adapter

import android.annotation.SuppressLint
import android.widget.TextView
import com.bw.vip.entity.VipEntity
import com.bw.viption.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import org.w3c.dom.Text

class MemberTypeAdapter:BaseQuickAdapter<MemberTypeBean,BaseViewHolder>(R.layout.item_menbertype) {
    @SuppressLint("ResourceAsColor")
    override fun convert(holder: BaseViewHolder, item: MemberTypeBean) {
        val tv = holder.getView<TextView>(R.id.member_type)
        tv.text = item.type
        if (item.isCheck){
            tv.setBackgroundResource(R.drawable.item_huang)
            tv.setTextColor(R.color.white)
        }else{
            tv.setBackgroundResource(R.drawable.item_bai)
            tv.setTextColor(R.color.black)
        }
    }

}

data class MemberTypeBean(val type:String,var isCheck:Boolean)